/*
 * FileName: Page.java
 *
 * Company: 北京神州泰岳软件股份有限公司
 * Copyright 2011-2012 (C) Ultrapower Software CO., LTD. All Rights Reserved.
 */
package com.lws.framework.dao;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * Description: 
 * </p>
 *
 * @author Administrator
 * @version 4.1

 * <p>
 * History: 
 *
 * Date                     Author         Version     Description
 * ---------------------------------------------------------------------------------
 * 2015-10-22 下午4:50:40          Administrator        4.1         To create
 * </p>
 *
 * @since 
 * @see     
 */
public class Page<T extends Serializable> {

    public static Integer DEFAULT_PAGE_SIZE = 10;

    /**
     * 页码
     */
    private Integer pageNo;

    /**
     * 容量
     */
    private Integer pageSize;

    /**
     * 数据
     */
    private List<T> data;

    /**
     * 
     */
    public Page() {
        this(1, DEFAULT_PAGE_SIZE, new ArrayList<T>());
    }

    /**
     * @param pageNo
     * @param pageSize
     * @param data
     */
    public Page(Integer pageNo, Integer pageSize, List<T> data) {
        this.pageNo = pageNo;
        this.pageSize = pageSize;
        this.data = data;
    }

    /**
     * 数据大小
     * @return
     */
    public Integer count() {
        return data.size();
    }

    /**
     * @return the pageNo
     */
    public Integer getPageNo() {
        return pageNo;
    }

    /**
     * @param pageNo the pageNo to set
     */
    public void setPageNo(Integer pageNo) {
        this.pageNo = pageNo;
    }

    /**
     * @return the pageSize
     */
    public Integer getPageSize() {
        return pageSize;
    }

    /**
     * @param pageSize the pageSize to set
     */
    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    /**
     * @return the data
     */
    public List<T> getData() {
        return data;
    }

    /**
     * @param data the data to set
     */
    public void setData(List<T> data) {
        this.data = data;
    }
}
